#!/bin/bash
#test cal value calculator for AQDAS 2 system
data=$(cat /tmp/05.out | grep API400A | awk '{ print substr($1,1,length($1)-4)}' )
cals=$(cat /tmp/05.out | grep ENVIRONICS | grep -v "Waiting for:" | awk '{ print substr($1,1,length($1)-3)}') 
comp="$data"
comp=$(echo -n "$comp"; echo \\n"$cals";)
# The following compares the flagged minuttes to the data minutes and removes duplicates
# producing a subset of minute from which to obtain values.
validminutes=$(echo -n "$comp" | sort | uniq -u) 
for i in "$validminutes"
do
cat /tmp/05.out | grep API400A | awk '/^'"$i"'/ { print $1" "$8}'
done
